﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InsumoInsertForm.aspx.cs" Inherits="UILGestion.Admin.InsumoInsertForm" %>

<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc2" %>

<%@ Register Assembly="SesarchResultLib" Namespace="SesarchResultLib" TagPrefix="cc1" %>
<%@ Register src="../../Control/menuCtrl.ascx" tagname="menuCtrl" tagprefix="uc1" %>
<%@ Register Assembly="ExtAspNet" Namespace="ExtAspNet" TagPrefix="ext" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>


<%--needed for WebMethods--%>
<%@ Import Namespace="System.Web.Script.Services" %>
<%@ Import Namespace="System.Web.Services" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    
     <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../../resources/css/main.css" rel="stylesheet" type="text/css" />
    
    <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />

    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    
    </head>
  <script type="text/javascript">
      function SelectInsumo(inp, data) {

          var insumo = inp.id;
          var id = insumo.replace("busquedaTextBox", "idPadreTextBox");
          var codigo = insumo.replace("busquedaTextBox", "codigoPadreTextBox");
          var nombre = insumo.replace("busquedaTextBox", "insumoPadreTextBox");



          inp.value = "";  //data[1];

          document.getElementById(codigo).value = data[1];
          document.getElementById(nombre).value = data[2];
          document.getElementById(id).value = data[0];




      }
      function clearSubFamilia() {
          document.getElementById("idPadreTextBox").value = "";
          document.getElementById("codigoPadreTextBox").value = "";
          document.getElementById("insumoPadreTextBox").value = "";
         
      }
  
  </script>
    

  
<body  >
 <form id="form1" runat="server" >
 <uc1:menuCtrl ID="menuCtrl1" runat="server" />
 <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"  EnablePartialRendering="true"  >
    </asp:ToolkitScriptManager>
 <input id="acabado" type="hidden" runat="server" />
 <asp:HiddenField ID="grupo" runat="server" />
     
     <asp:Panel ID="Panelcab" runat="server" Visible="false"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header">
  <asp:Label ID="tituloLabel" runat="server" Text="EDITAR INSUMOS" style="font-size: large; color: #960818"></asp:Label>
 </asp:Panel>
  
 <asp:Panel ID="PanelButtom" runat="server" Visible="false"
  BackColor="white">
     
  
                   <table >
<tr>

<td>
    <asp:Button ID="saveButton" runat="server" Text="Guardar" CssClass="ms-crm-List-Header"     OnClick="btnSaveContinue_Click"     /></td>
<td> <asp:Button ID="refreshButton" runat="server" Text="Restablecer"  CssClass="ms-crm-List-Header"   onclick="refreshButton_Click"     />
</td>
        <td></td>
        <td><asp:Button ID="cancelarButton" runat="server" Text="Cancelar" CssClass="ms-crm-List-Header"   
       OnClick="btnSaveContinue_Click" Width="80px" />
   </td>  <%--onclick="refreshButton_Click" --%>
 
</tr>
</table>
     
  <hr />
   </asp:Panel>
    <asp:Panel ID="pnlMain" runat="server" Visible="false"
  BackColor="white">
            
      <input type="hidden" runat="server" name="internalid" id="internalid" />      
       <input id="type" type="hidden" runat="server" />
       <table>
           <tr>
               <td>
                   <asp:UpdatePanel ID="panelClase" runat="server" UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                       <asp:Label ID="claseLabel" runat="server" Text=" Clase:"></asp:Label>
                                  

                                       
                                   </td>
                                   <td>
                                       <cc2:DropDownCC ID="claseDropDownList" runat="server" AutoPostBack="true" 
                                           OnSelectedIndexChanged="claseDDL_SelectedIndexChanged" 
                                           Width="370" />
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
                   <asp:UpdatePanel ID="panelFamilia" runat="server" UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                       <asp:Label ID="familiaLabel" runat="server" Text="Familia:"></asp:Label>
                                   
                                   

                                      
                                   </td>
                                   </td>
                                   <td>
                                       <cc2:DropDownCC ID="FamiliaDropDownList" runat="server" AutoPostBack="true" 
                                           OnSelectedIndexChanged="familiaDDL_SelectedIndexChanged" 
                                           Width="370" />
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                       <Triggers>
                           <asp:PostBackTrigger ControlID="claseDropDownList" />
                       </Triggers>
                   </asp:UpdatePanel>
                   <asp:UpdatePanel ID="subFamiliaUpdatePanel" runat="server" 
                       UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                   
                                      
                                       <asp:Label ID="subFamiliaLabel" runat="server" Text="Sub Familia:"></asp:Label>
                                   </td>
                                   <td>
                                       <cc2:DropDownCC ID="subFamiliaDropDownList" runat="server" AutoPostBack="true" 
                                           OnSelectedIndexChanged="subFamiliaDDL_SelectedIndexChanged" 
                                           Width="370" />
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
                   <table width="90%">
                       <tr>
                           <td align="right" Width="100px">
                           Codigo:
                               </td>
                           <td>
                               <asp:UpdatePanel ID="panelCodigo" runat="server" UpdateMode="Conditional">
                                   <ContentTemplate>
                                       <asp:Label ID="codigoTextBox" runat="server"></asp:Label>
                                       <input type="hidden" runat="server" name="idPadre" id="idPadre" />
                                       <input type="hidden" runat="server" name="nivel" id="nivel" />
                                   </ContentTemplate>
                               </asp:UpdatePanel>
                           </td>
                       </tr>
                       <tr>
                           <td align="right" Width="100px">
                               Descripcion:</td>
                           <td>
                               <cc2:PostTextBox ID="descripcionTextBox" runat="server" DataType="List" 
                                   method="GetRecursos" Width="450px" />
                               <%--OnSelect="SelectInsumo"--%>
                           </td>
                       </tr>
                   </table>
                   <asp:UpdatePanel ID="unidadUpdatePanel" runat="server" UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                   
                                       
                                       <asp:Label ID="unidadLabel" runat="server" Text="Unidad:"></asp:Label>
                                   </td>
                                   <td>
                                       <cc2:DropDownCC ID="unidadDropDownList" runat="server" 
                                           Width="200px" />
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
                   <asp:UpdatePanel ID="planCuentaUpdatePanel" runat="server" 
                       UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                   
                                   
                                       <asp:Label ID="planCuenta" runat="server" Text="Plan Cuenta:"></asp:Label>
                                   </td>
                                   <td>
                                       <cc1:Input ID="cuentaTextBox" runat="server" Width="450px"></cc1:Input>
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
                   <asp:UpdatePanel ID="controlStockUpdatePanel" runat="server" 
                       UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                   
                                       <asp:Label ID="controlStockLabel" runat="server" Text="Control de Stock:"></asp:Label>   
                                   </td>
                                   <td>
                                       <asp:CheckBox ID="controlStockCheckBox" runat="server"  />
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
                   <asp:UpdatePanel ID="revisadoUpdatePanel" runat="server" 
                       UpdateMode="Conditional">
                       <ContentTemplate>
                           <table>
                               <tr>
                                   <td align="right" Width="100px">
                                   
                                   
                                       <asp:Label ID="revisadoLabel" runat="server" Text="Revisado:"></asp:Label>
                                   </td>
                                   <td>
                                       <asp:CheckBox ID="verificacionCheckBox" runat="server" />
                                   </td>
                               </tr>
                           </table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
           
      </asp:Panel>
       
  
 
  
    </form>
</body>
</html>
